﻿@{
    ViewBag.Title = "添加";
    Layout = "../Shared/_Layout.cshtml";
}
@using mscook.mvc;
@model mscook.core.domain.Slide

@section JavaScript
{
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.validate.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.validate.unobtrusive.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.unobtrusive-ajax.js")"></script>
}
@Html.Partial("_BtnModalLoder")
<script type="text/javascript">
    var type = "";
    $("button.modalLoder").live("click", function () {
        type = $(this).data("type");
        return false;
    });

    $(".modal a.btn-success").live("click", function () {
        $("#LinkType").val(type);
        return false;
    });


</script>

<div id="hotelModal" class="modal hide fade form-horizontal">
</div>
<div id="chefModal" class="modal hide fade form-horizontal">
</div>
<div id="magazineModal" class="modal hide fade form-horizontal">
</div>
<div id="bulletinModal" class="modal hide fade form-horizontal">
</div>
<div class="row-fluid sortable">
    <div class="box span12">
        <div class="box-header well" data-original-title>
            <h2><i class="icon-edit"></i>Form Elements</h2>
            <div class="box-icon">
                <a href="@Url.Action("Add")" class="btn btn-setting btn-round"><i class="icon-plus-sign"></i></a>
            </div>
        </div>
        <div class="box-content">
            @using (Html.BeginForm("add", "slide", FormMethod.Post, new { @class = "form-horizontal", enctype = "multipart/form-data" }))
            {
                <fieldset>
                    <legend>幻灯片增加</legend>
                    <div class="control-group">
                        <label class="control-label">标题</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(slide => slide.Title, new { size = "16" })

                            </div>
                            @Html.ValidationMessageFor(slide => slide.Title)
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">位置(1在前2在后)</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(slide => slide.EntityIndex, new { size = "16" })

                            </div>
                            @Html.ValidationMessageFor(slide => slide.EntityIndex)
                        </div>
                    </div>

                    
                    <div class="control-group">
                        <label class="control-label">图片</label>
                        <div class="controls">
                            <div class="input-prepend" style="width: 400px">
                                <img id="preview" style="display: none; width: 100%" />
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">图片上传</label>
                        <div class="controls">
                            <div class="fileupload fileupload-new" data-provides="fileupload">
                                <span class="btn btn-file">
                                    <span class="fileupload-new">请选择图片</span>
                                    <span class="fileupload-exists">更改图片</span>
                                    <input name="related_content_image[0]" type="file" />
                                </span>
                                <span class="fileupload-preview"></span>
                                <a href="#" class="close fileupload-exists" data-dismiss="fileupload" style="float: none">×</a>
                            </div>
                        </div>
                    </div>
                    <div class="form-actions">
                        <button type="submit" class="btn btn-primary">保存</button>
                    </div>
                </fieldset>
            }
        </div>
    </div>
    <!--/span-->

</div>
